package cn.shujuhai.cms.service.impl;

import cn.shujuhai.common.pluging.data.ResultVo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.shujuhai.cms.domain.ArticleParam;
import cn.shujuhai.cms.service.ArticleParamService;
import cn.shujuhai.cms.mapper.ArticleParamMapper;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * @author 4g0
 * @description 针对表【article_param】的数据库操作Service实现
 * @createDate 2025-08-08 11:42:53
 */
@Service
public class ArticleParamServiceImpl extends ServiceImpl<ArticleParamMapper, ArticleParam>
        implements ArticleParamService {

    @Override
    public ResultVo<?> getList(Long articleId) {
        List<ArticleParam> list = this.list(new QueryWrapper<ArticleParam>().lambda().eq(ArticleParam::getArticleId, articleId));
        if (list.isEmpty()) {
            return ResultVo.success(Collections.emptyList());
        }
        return ResultVo.success(list);
    }
}




